Skip to main content

Face Authentication API (v2)

The following document highlights the details of the Face Authentication API (v2).

API Description

Objective

The Face Authentication API (v2) verifies if the selfie provided in the request matches the image corresponding to a unique identifier (UID) in the database.

InputOutput
The selfie of the customer and the unique transaction ID.It reflects if the database contains a record that matches the selfie.

API URL

https://ind-orion.hyperverge.co/v2/faceAuth

API Endpoint

faceAuth

Overview

The Face Authentication API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the Face Authentication API.

Headers

The following table provides the complete information on the request headers for the Face Authentication API.

HeaderMandatory / OptionalDescriptionInput Format
content-typeMandatoryThis parameter defines the media type for the request payload.multipart/form-data
acceptMandatoryThis parameter defines the media type for the response.application/json
appIdMandatoryApplication ID shared by HyperVerge.N/A. This is a unique value.
appKeyMandatoryApplication Key shared by HyperVerge.N/A. This is a unique value.

Inputs

The following table provides the complete information on the input parameters used in the request body for the Face Authentication API.

ParameterMandatory / OptionalTypeDescriptionInput Format
transactionIdMandatorystringThe unique identifier for the customer's application.String
uidTypeMandatorystringThe type of the unique identifier. It can be the transaction ID or any other unique identifier for the enrolment.

Note
It is commonly configured as "transaction_id".
String (e.g. transaction_id)
uidMandatorystringThe unique identifier for the record in your database used during enrolment.

Note
It is commonly configured as the transaction ID for the record.
String
selfieMandatoryfileThis is the selfie image of the user. The maximum image size is 6 MB.Image file (max 6 MB)

Additional Quality and Fraud Checks

In addition to its liveness and face match checks, the Face Authentication API can also execute additional checks on the image. You can view the complete list under the Additional Checks For Liveness page.

Note

If you include any quality check parameter in the request, the result is added to the qualityChecks object in the response.

Request

The following code snippet demonstrates a standard curl request for the Face Authentication API:

curl --location --request POST 'https://ind-orion.hyperverge.co/v2/faceAuth' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--form 'transactionId="<Enter_the_HyperVerge_transactionID>"' \
--form 'uidType="transaction_id"' \
--form 'uid="<Enter_the_Unique_Identifier>"' \
--form 'selfie=@"<path_to_selfie_image>"' \
--form 'ignoreSelfieQuality="<yes_or_no>"'

Success Response

The following code snippet demonstrates a response for a matching record in the database from the Face Authentication API:

{
"status": "success",
"statusCode": 200,
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
},
"result": {
"data": {
"matchScore": 99,
"match": "yes"
},
"summary": {
"action": "pass",
"details": []
}
}
}

Success Response Details

The following table provides the details of the parameters in a successful response from the Face Authentication API.

ParameterTypeDescription
statusStringIndicates whether the request was successful.
statusCodeIntegerHTTP status code of the response.
metaData.requestIdStringUnique identifier for the request.
metaData.transactionIdStringThe transaction ID sent in the request.
result.data.matchScoreIntegerNumeric face match score (0–100).
result.data.matchStringWhether the selfie matches the enrolled image ("yes" or "no").
result.summary.actionString

It displays the recommended decision for the customer. It can take any of the values from the following table.

ActionRecommendation
passYou can proceed with the application. Returned when the selfie matches the enrolled image (match=yes).
failDo not proceed. Returned for face mismatch (E200, match score 0–20), non-live selfie (E202), or no record found (E203). See result.summary.details for code and message.
manualReviewRequires manual review for further approval or rejection. Returned when match score is in the grey zone (E204, match score 21–50).
retakeAsk the user to retake the selfie. Returned when selfie quality is insufficient (E201).
result.summary.detailsArrayList of detail objects containing code (e.g. E200, E201, E202, E203, E204) and message when applicable.

Failure Responses

The following are the failure responses for the Face Authentication API. Alternatively, you can find the details of the failure responses listed here.

{
"status": "success",
"statusCode": 200,
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
},
"result": {
"data": {
"matchScore": 10,
"match": "no"
},
"summary": {
"action": "fail",
"details": [
{
"code": "E200",
"message": "Face mismatch"
}
]
}
}
}

Error Responses

The following are the error responses for the Face Authentication API.

{
"error": "\"transactionId\" is required",
"statusCode": 400,
"status": "failure",
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}

Error Response Details

A response from the Face Authentication API can be either a failure or an error. The following table lists all failure and error responses, along with their respective status codes, error messages, descriptions, and suggested resolutions.

Status CodeError MessageError DescriptionError Resolution
200Face mismatch (E200)The face matching score is 0–20, resulting in a failed match. summary.action is fail.Retry with a clearer selfie or ensure the user's face matches the enrolled image.
200Face mismatch – manual review (E204)Match score is in the grey zone (21–50). summary.action is manualReview.Review the case manually or retry with a better quality selfie.
422Selfie Quality is Insufficient (E201)The selfie blur check failed. summary.action is retake.Ask the user to retake the selfie with better lighting and clarity.
422Selfie is Not Live (E202)The liveness check failed. summary.action is fail.Use a live selfie capture flow and retry.
404No Record Found (E203)UID not enrolled in the database. summary.action is fail.Verify the transaction ID and ensure enrolment was completed for this user.
400Face Not DetectedThe Face Authentication API failed to detect a face in the selfie image.Ensure the selfie contains a single, clearly visible face and retry.
400"transactionId" is requiredThe request does not contain the transaction identification number.Include a valid transactionId in the request body.
401Missing/Invalid credentialsThe request either does not contain the mandatory credentials or contains invalid credentials.Provide valid appId and appKey headers.
404Lendernode not foundThe Face Authentication API failed to get the lender node.Contact the HyperVerge team to verify your configuration.
429Requests rate limit exceededThe number of transactions per minute has crossed the limit set for your credentials.Throttle requests or contact HyperVerge to increase the rate limit.
500Internal Server ErrorThere is an error with HyperVerge's server. Kindly contact the HyperVerge team for resolution.Contact the HyperVerge team for resolution.
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: